/*****************************************************************
 MYD Engine v0.1

 File: myd_sprite.h
 Created: 26/06/09
*****************************************************************/

#ifndef MYD_SPRITE_H
#define MYD_SPRITE_H

#include "system/myd_system.h"
#include "myd_entity.h"
#include "graphics/graphicsstructs.h"
#include "graphics/myd_texture.h"
#include "animation/myd_animation.h"
#include "io/myd_parser.h"

namespace myd
{
	class MYD_API Sprite : public Entity
	{
		//constructor / destructor
		public:
			Sprite();
			~Sprite(){;}

		//clones a sprite
			void clone(Sprite& tm_Sprite);

		//inherited from Entity
			void draw(Renderer& tm_Renderer) const;
			void update(float fTimeBetweenFrames);
		//collision from Entity
			void onCollide(Entity *entity);

		//texture handling
			void setTexture(Texture::Ptr tm_Texture);
			const Texture::Ptr getTexture() const;

			void setTextureArea (unsigned int uiOffsetX, 
								unsigned int uiOffsetY, 
								unsigned int uiWidth, 
								unsigned int uiHeight); 

		//animation
			void setAnimation(char* defFileName, bool tm_looped);
			void toggleAnimation(bool toggle);

		//properties
			TextureVertex vertices[4];
			Texture::Ptr wn_Texture;
			Animation *currentAnim;
			Parser *animParser;

//LIMARDI animation
		float count;
	};
#include "myd_sprite.inl"
}//end namespace
#endif //MYD_SPRITE_H
